home *** CD-ROM | disk | FTP | other *** search
- Path: taco.cc.ncsu.edu!rbsteven
- From: rbsteven@eos.ncsu.edu (Robert Barclay Stevenson)
- Newsgroups: comp.lang.c++
- Subject: I/O Streams...Question?
- Date: 31 Jan 1996 22:04:53 GMT
- Organization: North Carolina State University, Project Eos
- Distribution: world
- Message-ID: <4eop25$8um@taco.cc.ncsu.edu>
- Reply-To: rbsteven@eos.ncsu.edu (Robert Barclay Stevenson)
- NNTP-Posting-Host: prez.sod.ncsu.edu
- Keywords: streams, c++, question, help
- Originator: rbsteven@prez.sod.ncsu.edu
-
-
- Hey there...
-
- I am relatively experienced with C programming, but recently adopted C++
- for a couple of short projects. Basically I would like to use the iostream
- class to handle stdin through a loop to build a list, something like:
-
- while (cin >> inputList[input_data]) {
-
- /*blah, blah, blah...*/
-
- }
-
- Problem is...I can't get out of the loop without checking some pre-condition
- and breaking out. I could get the user to put a sentinel like 'Q' or something
- at the end of the stream, but it would not really be the ideal solution.
- Anyways if any out there has a suggestion to get the loop to evaluate false and
- fail so the rest of the code that follows could be used I'd be in appreciation...
-
- Thanks in advance...
- --
- --------------------------------------------------------------------------------
- Robert Stevenson | "Virtual Reality won't merely replace TV.
- Sys Adm/Design Research | It will eat it alive." A.C. Clarke
- Virtual Environments Lab |
-